package com.lzw.breezeNovel.webApp.controller.novel;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.webApp.service.novel.ReadTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller
 * @date 2025/3/6
 * @description 阅读时间
 */
@RestController
@RequestMapping("/app/readTime")
@SuppressWarnings("all")
public class ReadTimeController {

    @Autowired
    private ReadTimeService readTimeService;

    /**
     * 保存用户阅读时间
     */
    @GetMapping("/save")
    public Result saveReadTime(@RequestParam String dayTime) {
        readTimeService.saveReadTime(dayTime);
        return Result.ok();
    }

    /**
     * 获取用户的于都时间
     */
    @GetMapping("/getReadTime")
    public Result<String> getReadTime() {
        String readTime = readTimeService.getReadTime();
        return Result.ok(readTime);
    }



}
